package com.yifeng.repo.flink.data.transport.dto;

import com.google.common.base.Strings;

/**
 * @author lijng5
 * @since 2023年02月21日 上午9:56
 */
public enum CdcTypeEnum {
    FULL("full", "全量"), 
    INCRE("incre", "增量");
    private final String type;
    private final String name;

    public String getType() {
        return type;
    }

    public static CdcTypeEnum parse(String type) {
        if (Strings.isNullOrEmpty(type)) {
            return null;
        }
        CdcTypeEnum[] coll = values();
        for (CdcTypeEnum item : coll) {
            if (item.getType().equals(type)) {
                return item;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    CdcTypeEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }
}
